package com.ruoyi.electricity.service.impl;

import com.ruoyi.electricity.domain.ElectricityEquipType;
import com.ruoyi.electricity.mapper.ElectricityEquipTypeMapper;
import com.ruoyi.electricity.service.ElectricityEquipTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ElectricityEquipTypeServiceImpl implements ElectricityEquipTypeService {
    @Autowired
    private ElectricityEquipTypeMapper electricityEquipTypeMapper;
    @Override
    public void deleteEquipAndEquipTypeAssociation(String equipCode) {
        electricityEquipTypeMapper.deleteEquipAndEquipTypeAssociation(equipCode);
    }

    @Override
    public void updateEquipAndEquipTypeAssociation(String equipCode, Integer equipTypeId) {
        electricityEquipTypeMapper.updateEquipAndEquipTypeAssociation(equipCode, equipTypeId);
    }

    /**
     * 查询设备类型
     */
    @Override
    public ElectricityEquipType selectElectricityEquipTypeById(Integer id)
    {
        return electricityEquipTypeMapper.selectElectricityEquipTypeById(id);
    }

    /**
     * 查询设备类型列表
     */
    @Override
    public List<ElectricityEquipType> selectElectricityEquipTypeList(ElectricityEquipType electricityEquipType)
    {
        return electricityEquipTypeMapper.selectElectricityEquipTypeList(electricityEquipType);
    }

    /**
     * 新增设备类型
     *
     * @param electricityEquipType 设备类型
     * @return 结果
     */
    @Override
    public int insertElectricityEquipType(ElectricityEquipType electricityEquipType)
    {
        return electricityEquipTypeMapper.insertElectricityEquipType(electricityEquipType);
    }

    /**
     * 修改设备类型
     *
     * @param electricityEquipType 设备类型
     * @return 结果
     */
    @Override
    public int updateElectricityEquipType(ElectricityEquipType electricityEquipType)
    {
        return electricityEquipTypeMapper.updateElectricityEquipType(electricityEquipType);
    }

    /**
     * 批量删除设备类型
     *
     * @param ids 需要删除的设备类型主键
     * @return 结果
     */
    @Override
    public int deleteElectricityEquipTypeByIds(Integer[] ids)
    {
        return electricityEquipTypeMapper.deleteElectricityEquipTypeByIds(ids);
    }

    /**
     * 删除设备类型信息
     *
     * @param id 设备类型主键
     * @return 结果
     */
    @Override
    public int deleteElectricityEquipTypeById(Integer id)
    {
        return electricityEquipTypeMapper.deleteElectricityEquipTypeById(id);
    }
}
